$(function(){
    let btn = $("#btn");
    let btns =$(".tu_top .img_2")
   let container =$(".container .list_right")
    window.onload=function(){
        // console.log(this);
        huoqu()
        .done(function(dataa){
            // console.log(dataa);
              xuanran(dataa.data) 
             
        })
    }

    function huoqu(){
        let options ={
            url:"http://127.0.0.1:8080/static/data/list.json",
            type:"GET",
           
            data : { current : 1 , pagesize : 4},
            datatype:"json"
        }
        
     return $.ajax(options)
    }
    function xuanran(data){
        container.html(data.map(item=>
            `
            <ul>
                <li>
                    <a href="./liebiaoxiangqing.html#id=${item.id}">
                    <div class="photo"><img src="${item.img}" alt=""></div>
                    </a>
                    <div class="min_photo">
                      <img src="${item.samll_img1}" alt="">
                      <img src="${item.samll_img2}" alt="">
                      <img src="${item.samll_img3}" alt="">
                      <img src="${item.samll_img4}" alt="">
                    </div>
                    <div class="price">${item.price}</div>
                    <div class="title">${item.title}</div>
                    <div class="rates">
                     <span class="sales" style="width: 65px;height: 19px;">${item.rates}</span>
                    </div>
                </li>
            </ul>
            `
            ).join(""))
       
    }
    
     
     
})
